<!DOCTYPE HTML>
<html lang="zh-CN"><head>
	<title>{$name}</title>
	<meta charset="UTF-8">
	<meta name="viewport" content=" initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=no">
	<link href="{$Think.config.RESOURCEURL}wx_assets/micontent/materiaDetail.css{$Think.config.RESOURCE_VER}" rel="stylesheet">
	<link href="{$Think.config.RESOURCEURL}wx_assets/css/common.css{$Think.config.RESOURCE_VER}" rel="stylesheet">
	<link href="{$Think.config.RESOURCEURL}wx_assets/dist/gmu.css{$Think.config.RESOURCE_VER}" rel="stylesheet" type="text/css">
	<link href="{$Think.config.RESOURCEURL}wx_assets/css/product/product_detail.css{$Think.config.RESOURCE_VER}" rel="stylesheet">
	<link href="{$Think.config.RESOURCEURL}wx_assets/css/product/activity_detail.css{$Think.config.RESOURCE_VER}" rel="stylesheet">
	<if condition="$mallHue.mallHue eq '1'">
		<link href="{$Think.config.RESOURCEURL}wx_assets/css/product/new_detail_blue.css{$Think.config.RESOURCE_VER}" rel="stylesheet">
		<else/>
		<link href="{$Think.config.RESOURCEURL}wx_assets/css/product/new_detail.css{$Think.config.RESOURCE_VER}" rel="stylesheet">
	</if>
	<link href="{$Think.config.RESOURCEURL}wx_assets/css/iconfont/font_tuan.css{$Think.config.RESOURCE_VER}" rel="stylesheet">
	<!-- <script src="http://sdk.talkingdata.com/app/h5/v1?appid=DE13C350F41F5DE78FEC51DB5DE730D1&vn=v2&vc=v2"></script> -->
	<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/zepto.1.1.3.min.js{$Think.config.RESOURCE_VER}"></script>
	<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/dist/gmu.min.js{$Think.config.RESOURCE_VER}"></script>
	<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/zepto.alert.js{$Think.config.RESOURCE_VER}"></script>
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/wx_share.js{$Think.config.RESOURCE_VER}"></script>
	<script src="{$Think.config.RESOURCEURL}wx_assets/js/util.js{$Think.config.RESOURCE_VER}" type="text/javascript"></script>
	<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/product/product.js{$Think.config.RESOURCE_VER}"></script>
	<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/product/cookie.js{$Think.config.RESOURCE_VER}"></script>
	<script src="{$Think.config.RESOURCEURL}wx_assets/js/product/timer.js{$Think.config.RESOURCE_VER}" type="text/javascript"></script>
</head>
<body>
<!--关注浮层 begin-->
<!--0表示未关注，1表示已关注-->
<if condition="$subscribe eq '0'">
	<div class="careview">
		<img src="{$mall.logo}" alt="" />
		<a href='{$mall.wechaturl}'>立即关注</a>
		<empty name="mall.recommend">
			<p>{$mall.wechatname}</p>
			<else />
			<p>{$mall.recommend}</p>
		</empty>

		<span></span>
	</div>
	<script>
		function closePlayMsgView(){
			$('.play_msg').hide();
		}
		$(function(){
			var isfirst=getCookie('new_detail');
			if(isfirst!=1)
			{
				$('.play_msg').show();
				setCookie("new_detail","1");
			}

		})

		$('.careview > span').on('click',function(){
			$('.careview').hide();
		});

	</script>
</if>
<!--关注浮层 end-->
<notempty name="headerTpl">
	<include file="$headerTpl" />
</notempty>
<!--<div class="shop-box">
   <a href="{$mall.storeurl}">{$mall.name}</a>
    <a href="{$mall.wechaturl}" class="fr">关注</a>
</div>-->
<if condition = "$teambuy eq '1'">
	<div class="play_msg">
		<div class="middle">
			<img src="{$Think.config.RESOURCEURL}wx_assets/images/product/tuan_play.png"/>
			<a onclick="closePlayMsgView()">我知道了</a>
		</div>
	</div>
</if>
<div class="detail-slider-container" style="margin-top: 0px;position:relative">
	<ul class="pro-list" id="detail-slider" >
		<volist name="picUrl1" id="picItem">
			<if condition="$i neq '1'">
				<li l="true">
					<img class="default" src="{$picItem:picUrl}">
				</li>
			</if>
		</volist>
	</ul>
	<if condition = "$inventory eq '1' AND $inventoryCount elt '0'">
		<div class="soldOut"></div>
	</if>
</div>
<script type="text/javascript">
	mi.PRODUCT_DETAIL._initSlide();
</script>
<if condition="$playType eq '4'">
	<div class="seckill">
		<if condition="$supportSpecification eq '1'">
			<php>if($minDisPrice>0&&$minDisPrice!=$maxDisPrice){</php>
				<span class="seck-bpri">￥<b>{$minDisPrice|floatval}~{$maxDisPrice|floatval}</b></span>
				<span class="seck-spri"><i style="text-decoration: line-through;">￥{$maxFixedPrice|floatval}</i></span>
			<php>}else if($minDisPrice>0){</php>
				<span class="seck-bpri">￥<b>{$minDisPrice|floatval}</b></span>
				<span class="seck-spri"><i style="text-decoration: line-through;">{$maxFixedPrice|floatval}</i></span>
			<php>}else if($minFixedPrice!=$maxFixedPrice){</php>
				<span class="seck-bpri">￥<b>{$minFixedPrice|floatval}~{$maxFixedPrice|floatval}</b></span>
			<php>}else if($minFixedPrice>0){</php>
				<span class="seck-bpri">￥<b>{$minFixedPrice|floatval}</b></span>
			<php>}else{</php>
				<span class="seck-bpri">免费</span>
			<php>}</php>
			<elseif condition="$discountedPrice gt '0'"/>
				<span class="seck-bpri">￥<b>{$discountedPrice}</b></span>
				<span class="seck-spri"><i style="text-decoration: line-through;">￥{$fixedPrice} </i></span>
			<elseif condition="$fixedPrice gt '0'"/>
				<span class="seck-bpri">￥<b>{$fixedPrice}</b></span>
			<else/>
				<span class="seck-bpri">免费</span>
		</if>
			         <span class="secktimer">
			         	<if condition="$seckillIsEnd eq '1'">
							已抢完
							<elseif condition="$seckillIsStart eq '1'"/>
							<p style="display:inline;color: white;" class="lxftime" nowtime="{$nowTime}" endtime="{$seckillEndtime}" col="0" lxfday="no" lxftext="距结束"></p>
							<else />
							<p style="display:inline;color: white;" class="lxftime" nowtime="{$nowTime}" endtime="{$seckillStartTime}" starttime="{$seckillEndtime}" col="0" lxfday="no" lxftext="距开始"></p>
						</if>
			         </span>
	</div>
	<script>
		lxfEndtime();
	</script>
</if>
<div class="pro-box">
	<if condition="$quanInfo neq ''">
		<dl class="pro-name">
			<dt style="display: -webkit-box;-webkit-box-pack: justify;">
			<h1 style="font-size: 16px;word-break: break-all;width: -webkit-calc(100% - 50px);">
				{$name}
			</h1>
			<div style="position: relative;width: 45px;text-align: center;color: {$mallHue.proDetailMainColor||default='#f75493'};font-size:12px;" id="share">
				<div style="position: absolute;left: 0;border-left: 1px solid #ccc;height: 25px;top: 5px;"></div>
				<i class="iconfont" style="display: block;text-align: center;font-size: 20px !important;position: relative;margin-top:2px;">&#xe615;</i>
				二维码
			</div>
			</dt>
		</dl>
		<else/>
		<dl class="pro-name">
			<dt>
			<h1 style="font-size: 16px;">
				{$name}
			</h1>
			</dt>
		</dl>
	</if>
	<div class="price" style="overflow: hidden;">
		<if condition="$freeBuy eq '1'">
			<style>
				.price{
					height: 26px;
				}
			</style>
			<div style="float: left;">
				￥{$freeBuyMoney[0]}~￥<php>echo end($freeBuyMoney);</php>
			</div>
			<elseif condition="$teambuy eq '1'"/>
			<if condition="$teamPrice gt '0'">
				<div style="float: left;">
					￥{$teamPrice|floatval}<del>￥{$fixedPrice|floatval}</del>
				</div>
				<else/>
				<div style="float: left;">
					免费
				</div>
			</if>
			<span class="priceTag">{$teamCount}人团</span><br/>
			<elseif condition="$playType eq '4'"/>
			<elseif condition="$playType eq '5' AND $isEnjoyMiPrice eq '1'"/>
			<if condition="$supportSpecification eq '1' and $minMiPrice neq $maxMiPrice">
				密友价：￥{$minMiPrice|floatval}~{$maxMiPrice|floatval}<del>￥{$maxFixedPrice|floatval}</del>
				<elseif condition="$supportSpecification eq '1' and $minMiPrice gt '0'"/>
				密友价：￥{$minMiPrice|floatval}<del>￥{$maxFixedPrice|floatval}</del>
				<elseif condition="$supportSpecification eq '1'"/>
				免费
				<elseif condition="$miPrice gt '0'"/>
				密友价：￥{$miPrice|floatval}<del>￥{$fixedPrice|floatval}</del>
				<else/>
				免费
			</if>
			<elseif condition="$supportSpecification eq '1'"/>
				<if condition="$minDisPrice gt 0 and $minDisPrice neq $maxDisPrice">
						￥{$minDisPrice|floatval}~{$maxDisPrice|floatval}<del>￥{$maxFixedPrice|floatval}</del>
					<elseif condition="$minDisPrice gt 0"/>
						￥{$minDisPrice|floatval}<del>￥{$maxFixedPrice|floatval}</del>
					<elseif condition="$minFixedPrice neq $maxFixedPrice"/>
						￥{$minFixedPrice|floatval}~{$maxFixedPrice|floatval}
					<else/>
						￥{$minFixedPrice|floatval}
				</if>
				<else/>
				<if condition="$discountedPrice neq ''">
					￥{$discountedPrice|floatval}<del>￥{$fixedPrice|floatval}</del>
					<else/>
					￥{$fixedPrice|floatval}
				</if>
		</if>
	</div>
	<if condition="$quanInfo neq '' and $isMiUserCut gt 0 and $isShowLish eq '1'">
		<div class="price" style="width:100%;overflow: hidden;margin-top: 0;font-size:12px;color:#333">
			密友立省<span style="color: {$mallHue.fontColor||default='#F65492'}">{$isMiUserCut}元</span>(仅密友可见)
		</div>
	</if>
		</div>
	<div class="pro-box activity_add" style="margin:10px 0">
        <ul>
			<li>
               <i class="lm_icon date">&#xe600;</i>
				活动时间:  {$activityTime}
			</li>
			<li id="activity_map">
				<i class="lm_icon place">&#xe602;</i>
				活动地点:  {$activityPlace}
			</li>
			<li>
				<i class="lm_icon num">&#xe601;</i>
				报名人数限制:  {$activityNum}
			</li>
		</ul>
	</div>

    <notempty name="priceTag">
	<div class="pro-box activity_add">
		<div class="pro-esp" <if condition="$recommend eq ''">style="margin-top:10px;"</if>>
		<volist name="priceTag" id="pct">
			<span><i class="iconfont">&#xe604;</i>{$pct}</span>
		</volist>
	</div>
	</div>
</notempty>
	<if condition="$recommend neq ''">
		<div class="pro-box activity_cs">
			<dl class="pro-name pro-recom" style="margin-top:0">
				<dt class="specialColor ly">{$recommend}</dt>
			</dl>
		</div>
	</if>

<if condition="$description neq ''">
	<div class="p-comment activity_cs" style="padding: 10px 10px 20px;font-size: 14px;color: #666;margin-top:10px">
		<div class="ly">
			{$description}
		</div>
	</div>
</if>
<!--<if condition="$microId neq '' and $mallShareTitle neq ''">-->
	<div class="p-comment" style="padding:20px;background: #fff url({$Think.config.RESOURCEURL}wx_assets/images/product/activity_arer.png) center center no-repeat;
    background-size: 100% 90%">
		<div style="overflow:hidden;margin-top: 10px;">
			<div style="width:57px;height:57px;text-align: center;float:left"><img src="{$mallShareLogo}" style="max-width:100%;max-height:100%"/></div>
			<div style="margin-left: 67px;">
				<div style="font-size: 16px;
    color: #2f2f2f;">{$mallShareTitle}</div>
				<div style="font-size:14px;color:#7E7D7D;">{$mallShareDesc}</div>
			</div>
		</div>
		<div style="margin-top: 10px;text-align: center;">
			<a style="color:{$mallHue.proDetailMainColor||default='#6895fd'};padding:2px 20px;border:1px solid {$mallHue.proDetailMainColor||default='#6895fd'};border-radius: 50px;line-height: 25px;" href="{$Think.config.SERVER_HOST}call.html?customerId={$customerId}&module=mall&method=getMall&params=%7B%22id%22:{$microId}%7D">进入专区</a></div>
	</div>
<!--</if>-->
<div class="p-comment" style="margin-top: 10px;display:none" id="p-comment">
</div>
<div class="p-detail" style="display:block">
	<h2 class="title_box">图文详情</h2>
	{$webPageContent}
</div>
<div class="mark" style=""></div>

<div class="tool-box">
	<dl>
		<if condition="$teambuy eq '1'">
			<dt>
				<!--<a id="car" class="car" onclick="detail.goCart('{$vId}')" >
                       <div class="num" id="carNum"></div>
                   </a>-->
				<a href="{$mall.storeurl}" class="left-btn">
					<i class="iconfont">&#xe605;</i>
					<p>首页</p>
				</a>
				<if condition="$favorite eq '1'">
					<a id="favorite" class="left-btn fav1" favorite="{$favorite}">
						<i class="iconfont">&#xe607;</i>
						<p>心愿</p>
					</a>
					<else/>
					<a id="favorite" class="left-btn" favorite="{$favorite}">
						<i class="iconfont">&#xe606;</i>
						<p>心愿</p>
					</a>
				</if>
			</dt>
			<dd>
				<a class="buy iteamBtn <if condition='$isStart neq 1 OR $isEnd eq 1'>btn-disabled</if>" id="buy-now" data-type="now"><span><php>if($activity==1){</php>直接报名<php>}else{</php>直接购买<php>}</php></span> <br />
					<notempty name="discountedPrice">
						<span>{$discountedPrice}/件</span>
					</notempty>
					<empty name="discountedPrice">
						<span>{$fixedPrice}/件</span>
					</empty>
				</a>
				<a class="add-car iteamBtn <if condition='$isStart neq 1 OR $isEnd eq 1'>btn-disabled</if>" id="buy-team" data-type="team" style="background-color:{$mallHue.proDetailMainColor||default='#f75493'}"><span><php>if($activity==1){</php>组团报名<php>}else{</php>组团买<php>}</php></span><br /><span>{$teamPrice}/件</span></a>

			</dd>
			<if condition='$isStart neq 1 OR $isEnd eq 1 or $hasList neq 1'>
				<else />
				<a class="btn-goteam" href="call.html?module=tuan&customerId={$customerId}&method=getTeamOrderList&params=%7B%22pid%22:{$id}%7D">即将成功的团</a>
			</if>
			<else/>
			<dt>
				<if condition="$activity neq '1'">
					<a href="{$mall.storeurl}" class="left-btn">
						<i class="iconfont">&#xe605;</i>
						<p>首页</p>
					</a>
				</if>
				<if condition="$favorite eq '1'">
					<a id="favorite" class="left-btn fav1" favorite="{$favorite}">
						<i class="iconfont">&#xe607;</i>
						<p>心愿</p>
					</a>
					<else/>
					<a id="favorite" class="left-btn" favorite="{$favorite}">
						<i class="iconfont">&#xe606;</i>
						<p>心愿</p>
					</a>
				</if>
			</dt>
			<dd>
				<if condition="$inventory eq '1' AND $inventoryCount elt '0' AND $supportSpecification eq '0'">
					<a class="add-car btn-disabled">加入购物车</a>
					<a class="buy btn-disabled"><php>if($activity==1){</php>立即报名<php>}else{</php>立即购买<php>}</php></a>
					<elseif condition="$freeBuy eq '1' AND $virtual eq '1'"/>
					<style>
						.tool-box dd
						{
							margin-left: 160px;
						}
					</style>
					<!-- <a class="add-car btn-disabled" id="addCar">加入购物车</a>-->
					<a class="buy" onclick="detail.productShow(this,1);"><php>if($activity==1){</php>立即报名<php>}else{</php>立即购买<php>}</php></a>
					<elseif condition="$freeBuy eq '1'"/>
					<a class="add-car" id="addCar" onclick="detail.productShow(this,0);">加入购物车</a>
					<a class="buy" onclick="detail.productShow(this,1);"><php>if($activity==1){</php>立即报名<php>}else{</php>立即购买<php>}</php></a>
					<elseif condition="$playType eq '4'"/>
					<php>if($seckillIsEnd!=1&&$seckillIsStart==1){</php>
					<a class="add-car" onclick="detail.productShow(this,0);" id="addCar">加入购物车</a>
					<a class="buy" onclick="detail.productShow(this,1);"><php>if($activity==1){</php>立即报名<php>}else{</php>立即购买<php>}</php></a>
					<php>}else{</php>
					<a class="add-car btn-disabled" id="addCar">加入购物车</a>
					<a class="buy btn-disabled" id="buy-now"><php>if($activity==1){</php>立即报名<php>}else{</php>立即购买<php>}</php></a>
					<php>}</php>
					<elseif condition="$virtual eq '1'"/>
					<!--<a class="add-car btn-disabled" id="addCar">加入购物车</a>-->
					<style>
						.tool-box dd
						{
							margin-left: 160px;
						}
					</style>
					<a class="buy" onclick="detail.productShow(this,1);"><php>if($activity==1){</php>立即报名<php>}else{</php>立即购买<php>}</php></a>
					<elseif condition="$playType eq '5' AND $isEnjoyMiPrice eq '1'"/>
					<a class="add-car" id="addCar" onclick="detail.productShow(this,0);">加入购物车</a>
					<a class="buy" onclick="detail.productShow(this,1);"><php>if($activity==1){</php>立即报名<php>}else{</php>立即购买<php>}</php></a>
					<else/>
					<a class="add-car" id="addCar" onclick="detail.productShow(this,0);">加入购物车</a>
					<a class="buy" onclick="detail.productShow(this,1);"><php>if($activity==1){</php>立即报名<php>}else{</php>立即购买<php>}</php></a>
				</if>
			</dd>
		</if>
	</dl>
</div>

<div id="evaluationpid" style="display:none;">{$id}</div>
<div class="fav-mask" id="FavMask">
	<div class="msg">
		耶！收藏成功,87%的人点击关注，便于查看收藏的商品。
	</div>
</div>
<input type="hidden" id="shareImg" value="<php>echo $picUrl1[1]->picUrl;</php>">
<notempty name="footerTpl">
	<include file="$footerTpl"/>
</notempty>
<div class="playWarm">
	<div>
		<a onclick="hidePlayWarm()" class="closeWarm"></a>
		<div>
			<img src="{$Think.config.RESOURCEURL}wx_assets/tuan/img/warm.png"/>
		</div>
	</div>
</div>
<a id="car" class="car" onclick="detail.goCart('{$vId}')">
	<i class="iconfont">&#xe608;</i>
		<span>
			<p id="carNum"></p>
		</span>
</a>
<script type="text/html" id="prop-tpl">
	<dl>
		<dt><%=pName%></dt>
		<%for(var i=0;i<pList.length;i++){%>
		<%if(pUrl[i]){%>
		<dd data-name="<%=pList[i]%>" style="vertical-align: top;"><img src="<%=pUrl[i]%>"/><label><%=pList[i]%></label></dd>
		<%}else{%>
		<dd data-name="<%=pList[i]%>" style="vertical-align: top;"><label style="float:none"><%=pList[i]%></label></dd>
		<%}%>
		<%}%>
	</dl>
</script>
<if condition="$teambuy eq '1'">
	<script>
		if($(window).height()<500)
		{
			$('.playWarm').addClass('small')
		}
		function hidePlayWarm(){
			$('.playWarm').hide();
			setCookie('playFirst',1);
		}
		var isFirst=getCookie('playFirst');
		//第一次来,弹出提示
		if(isFirst==null)
		{
//		$('.playWarm').show();
		}
		else if(isFirst==1)
		{
			$('.playWarm').hide();
		}

	</script>
</if>
<script type="text/javascript" charset="utf-8">
	var previewImageUrls=[];
	var pImgs=$(".p-detail img");
	pImgs.each(function(){
		var url=$(this).attr("src") || $(this).attr("original");
		previewImageUrls.push(url);
	});
	//图片预览
	pImgs.click(function(){
		var url=$(this).attr("src") || $(this).attr("original");
		var par=$(this).parent();
		if(par && par.length>0 && par[0].tagName.toUpperCase()!=="A"){
			wx.previewImage({
				current: url,
				urls: previewImageUrls
			});
		}
	})
	var shareData = {
			visitId: "{$visitId}",
			lastShareUId: '{$lastShareUId}'
	}
</script>
<!--<script type="text/html" id="commentTpl">
    <%if(list && list.length){
    for(var i=0;i<list.length;i++){
    var item = list[i];
    var imgs = list[i].imgurl;
     item.RESOURCEURL="{$Think.config.RESOURCEURL}";
    %>
    <div class="main">
        <div class="info">
			<%if(item.headImgUrl) {%>
    			<span class="head"><img src="<%=item.headImgUrl%>"></span>
                <span class="name"><%=item.nickName%></span>
            <%} else {%>
                <span class="head"><img src="<%=item.RESOURCEURL%>wx_assets/images/defaultHeadImg.png"></span>
                <span class="name">匿名用户</span>
            <%}%>
            <span class="time"><%=item.createTime%></span>
        </div>
        <div class="commen"><%=item.comment%></div>
        <%if(imgs && imgs.length){%>
            <div class="comnt-img">
                   <% for (var y=0;y<imgs.length;y++) {%>
                    <div>
                        <img src="<%=imgs[y]%>@320h_320w_1e_1c"/>
                    </div>
                    <%}%>
            </div>
        <%}%>
        <%if(item.sizeName) {%>
            <div class="spec">规格：<%=item.sizeName%>&nbsp;&nbsp;<%=item.colorName%></div>
        <%}%>
    </div>
    <%}}else{%>
    <div class='no-comment'>来晒单嘛！有了你，我就不再孤独！</div>
    <%}%>
</script>-->
<script type="text/html" id="commentTpl">
	<%if(list && list.length){%>
	<h2 class="title_box">大家怎么说</h2>
	<%for(var i=0;i<list.length;i++){
	var item = list[i];
	var imgs = list[i].imgurl;
	item.RESOURCEURL="{$Think.config.RESOURCEURL}";
	%>
	<div class="main">
		<div class="info">
			<%if(item.headImgUrl) {%>
			<span class="head"><img src="<%=item.headImgUrl%>"></span>
			<span class="name"><%=item.nickName%></span>
			<%} else {%>
			<span class="head"><img src="<%=item.RESOURCEURL%>wx_assets/images/defaultHeadImg.png"></span>
			<span class="name">匿名用户</span>
			<%}%>
			<span class="time"><%=item.createTime%></span>
		</div>
		<div class="commen"><%=item.comment%></div>
		<%if(imgs && imgs.length){%>
		<div class="comnt-img">
			<% for (var y=0;y<imgs.length;y++) {%>
			<div>
				<img src="<%=imgs[y]%>@320h_320w_1e_1c"/>
			</div>
			<%}%>
		</div>
		<%}%>
		<%if(item.sizeName) {%>
		<div class="spec">规格：<%=item.sizeName%>&nbsp;&nbsp;<%=item.colorName%></div>
		<%}%>
	</div>
	<%}%>
	<a href="call.html?userName=&customerId={$customerId}&module=product&method=getcommentList&params=%7B%22pid%22:{$id}%7D" class="getmore">查看更多口碑</a>
	<%}%>

</script>
<style>
	.mask{
		position: fixed;
		background-color: rgba(0,0,0,.8);
		height: 100%;
		z-index: 999;
		width: 100%;
		color: white;
		top:0;
		display:none;
	}
	.mask img{
		position: absolute;
		right: 20px;
		top: 0;
		width: 100px;
		height: 100px;
	}
	.mask span{
		display: block;
		width: 305px;
		margin: 20px auto 0;
		line-height: 23px;
	}
</style>
<div class="mask">
	<img src="{$Think.config.RESOURCEURL}wx_assets/images/product/fav-arrow.png{$Think.config.RESOURCE_VER}"/>
	<span style="margin-top:158px;">点击右上角“分享”按钮<br/>选择“发送给朋友”或者“分享到朋友圈”<br/>或者“复制链接”后发送链接给朋友</span>
	<span>{$recommend}</span>
	<span>长按选中后复制推荐理由。</span>
</div>
<div class="productInfo" id="productInfo" style="z-index:100">
	<div class="main">
		<div class="info">
			<div class="closeDiv"><div class="close" id="close"></div></div>
			<div class="imgDiv" align="center" onclick="product.toDetail('<%=fromCustomerId%>','<%=id%>')">
				<volist name="picUrl1" id="picItem">
					<if condition="$i eq '2'">
						<img class="default" src="{$picItem:picUrl}">
					</if>
				</volist>
			</div>
			<div class="p-name" onclick="product.toDetail('<%=fromCustomerId%>','<%=id%>')">
				<div class="title">
					<if condition="$freeBuy eq '1'">
						<span>由你定价</span>&nbsp;
					</if>
					{$name}
				</div>
				<div class="price" style="overflow: hidden;height: 26px;">
					<if condition="$freeBuy eq '1'">
						￥{$freeBuyMoney[0]}~￥<php>echo end($freeBuyMoney);</php>
						<elseif condition="$supportSpecification eq '1'"/>
						<div style="float: left;" id="buyPrice">
							<if condition="$playType eq '5' AND $isEnjoyMiPrice eq '1' and $minMiPrice neq $maxMiPrice">
								密友价：￥{$minMiPrice|floatval}~{$maxMiPrice|floatval}
								<elseif condition="$playType eq '5' AND $isEnjoyMiPrice eq '1'"/>
								密友价：￥{$minMiPrice|floatval}
								<elseif condition="$minDisPrice gt 0 and $minDisPrice neq $maxDisPrice"/>
								￥{$minDisPrice|floatval}~{$maxDisPrice|floatval}
								<elseif condition="$minDisPrice gt 0"/>
								￥{$minDisPrice|floatval}
								<elseif condition="$minFixedPrice neq $maxFixedPrice"/>
								￥{$minFixedPrice|floatval}~{$maxFixedPrice|floatval}
								<else/>
								￥{$minFixedPrice|floatval}
							</if>
						</div>
						<else/>
						<div style="float: left;" id="buyPrice">
							<if condition="$playType eq '5' AND $isEnjoyMiPrice eq '1'">
								密友价：￥{$miPrice|floatval}
								<elseif condition="$discountedPrice neq ''"/>
								￥{$discountedPrice|floatval}
								<elseif condition="$activity eq '1' and $fixedPrice eq '0'"/>
								免费
								<else/>
								￥{$fixedPrice|floatval}
							</if>
						</div>
						<!--<div>
							<volist name="priceTag" id="pct">
			            		<span class="priceTag">{$pct}</span>
			            	</volist>
			            </div>-->
					</if>

				</div>
			</div>
		</div>
		<if condition="$customized neq ''">
			<div style="max-height:250px;overflow-y: scroll;">
			<else/>
			<div style="max-height:250px;">
		</if>
		<if condition="$supportSpecification eq '1'">
			<div class="mod_property" id="prop-list"></div>
		</if>
		<if condition="$freeBuy eq '1'">
			<div class="mod_property" id="free-list">
				<dl>
					<dt>请选择价格</dt>
					<volist name="freeBuyMoney" id="money">
						<dd data-value="{$money}"><label style="float:none">{$money}</label></dd>
					</volist>
					<dt id="invitation" style="display:none;margin-bottom:0;"></dt>
				</dl>
			</div>
		</if>
		<if condition="$customized neq ''">
			<style>
				.customizedDescription{
					width:100%;
					height:30px;
					-webkit-appearance: none;
					font-size:14px;
					border:1px solid #ccc;
					border-radius:4px;
					padding:0 10px;
					box-sizing:border-box;
				}
			</style>
			<ul class="" id="customized">
				<volist name="customized" id="cus">
					<li style="line-height:30px;border-bottom: 1px solid #ebebeb;">
						<div class="customizedName" style="margin:10px 10px 10px 0;">{$cus.name}</div>
						<if condition="$cus.type eq '2'">
							<div style="margin: 10px 0;">
								<select class="customizedDescription" data-type="{$cus.type}">
									<volist name="cus.description" id="des">
										<option value="{$des}">{$des}</option>
									</volist>
								</select></div>
							<elseif condition="$cus.type eq '1'"/>
							<div style="margin: 10px 0;">
								<input class="customizedDescription" type="datetime-local" value="{$customizedTime}" data-type="{$cus.type}"/>
							</div>
							<else/>
							<div style="margin: 10px 0;">
								<input class="customizedDescription" type="text" placeholder="{$cus.description}" data-type="{$cus.type}"/>
							</div>
						</if>
					</li>
				</volist>

			</ul>
		</if>
			<div class="buyNum">
				<div class="title">报名人数</div>
				<div class="numDiv">
					<a class="sub disabled" tag="sub" id="sub"></a>
					<input type="number" min="1" max="10000" step="1" value="1" class="num" id="buyNum"/>
					<if condition="$inventory eq '1' AND $supportSpecification eq '0' AND $inventoryCount lt 2">
						<a class="plus disabled" tag="add" id="plus1"></a>
						<else/>
						<a class="plus" tag="add" id="plus"></a>
					</if>

				</div>
				<notempty name="inventory">
					<if condition="$supportSpecification eq '0' AND $inventoryCount gt 0">
						<span class="inventory" id="inventory_count" style='display:block'>&nbsp;剩余<span id="stock-num">{$inventoryCount}</span>件</span>
						<else/>
						<span class="inventory" id="inventory_count" style="display:none">&nbsp;剩余<span id="stock-num">{$inventoryCount}</span>件</span>
					</if>
					<!--stockCount-->
				</notempty>
			</div>
		</div>
	</div>
	<if condition="$inventory neq '' AND $supportSpecification eq '0' AND $inventoryCount eq ''">
		<div class="beSure btn_disabled">确定</div>
		<else/>
		<div class="beSure">确定</div>
	</if>

</div>
<script type="text/javascript">
	var pid = {$id};
	var favoriteCount = {$favoriteCount};
	var availSku = '{$availSku}';
	availSku = encodeURIComponent(availSku);
	var sku = new Array();
	var orderType, availSku, cku, totalStock, bookEndTime, bookBeginTime, isNew, wxInfo;
	var size = {$size};
	if (size != null) {
		var sizeUnit = "{$sizeUnit}";
		var sizeUrl = JSON.parse('{$sizeurl}');
		sku.push({"pList": size, "pName":sizeUnit,"pUrl":sizeUrl,"availSku":availSku});
	}
	var color = {$color};
	if (color != null) {
		var colorUnit = "{$colorUnit}";
		var colorUrl = JSON.parse('{$colorurl}');
		sku.push({"pList": color, "pName":colorUnit,"pUrl":colorUrl,"availSku":availSku});
	}
	if (size == null && color == null) {
		sku = [];
		availSku = [];
	} else {
		availSku = {$availSku} == null ? [] : {$availSku};
		$('#inventory_count').hide();
	}
	var inventory = {$inventory};
	var totalInventoryCount = {$inventoryCount};
	var freeBuy = "{$freeBuy}";
	var freeBuyMoney = "{$freeBuyMoney}";
	var price = "{$discountedPrice}"||"{$fixedPrice}";
	$("#free-list").css("bottom",-$("#free-list").height()+"px");
	var orderType = '{$fixedPrice}' === '' ? 'point' : 'buy';
	if (orderType === 'point') {
		var isMember = parseInt('{$isMember}');
		var isCheck = parseInt('{$isCheck}');
		var points = parseInt('{$points}');
		var myScore = parseInt('{$myScore}');
	}
	var isNew = "false";
	var wxInfo = { "isFocus": "true", "wxId": "ONLY_BESTSELLER" };

</script>
<script type="text/javascript">
	var baseUrl = '{$Think.config.SERVER_HOST}';
	var hrefPath = baseUrl+'call.html?customerId={$customerId}';
	var basePath = baseUrl+'call.json?customerId={$customerId}&userName={$userName}';
	var p=$.util.getParamAsObject();
	var isTeamPro="{$teambuy}";
	var distributionId = "{$distributionId}";
	var teamBuyType = '';
	var playType = "{$playType}";
	var seckillIsStart = "{$seckillIsStart}";
	var seckillIsEnd = "{$seckillIsEnd}";
	var teamId=p.teamId || "";
	var buyParams={
		"pids": "{$id}",
		"type": "buy",
		"qId":p.qId||"{$quanInfo.qId}",
		"miUId":p.miUId||"{$quanInfo.uId}",
		"vId":"{$vId}",
		"shareId":"{$sId}",
		"shareFromGuid":p.fromGuid,
		"userName":'{$userName}',
		"visitId":"{$visitId}",
		"distributionId":distributionId,
		"proSource":'{$proSource}'
	};
	var detail={
		pageSize:3,
		page:0,
		cartList:null,//购物车详情
		guid:"{$guid}",
		init:function(){
			this._initProp();
			this._initEvent();
			this._initTab();
		},
		_initProp: function(){
			var size = {$size};
			var color= {$color};
			var freebuy = '{$freeBuy}';
			var sku;
			if(size){
				var sizeUnit = '{$sizeUnit}';
				var sizeUrl = JSON.parse('{$sizeurl}');
				sku = {"pList": size,"pUrl":sizeUrl,"pName":sizeUnit};
				var html=template("prop-tpl", sku),
						container=$("#prop-list");
				container.append(html);
			}
			if(color){
				var colorUnit = '{$colorUnit}';
				var colorUrl = JSON.parse('{$colorurl}');
				sku={"pList": color,"pUrl":colorUrl,"pName":colorUnit};
				var html=template("prop-tpl", sku),
						container=$("#prop-list");
				container.append(html);
			}
			$("#productInfo").css("bottom",($("#productInfo").height()+50)*-1);
		},
		/*团购相关扩展*/
		tuan:{
			createTeamOrder: function(oid,callback) {
				var p=$.util.getParamAsObject();
				p.pid="{$id}";
				p.oid=oid;
				$.req.get("call.json?customerId={$customerId}&module=tuan&method=createTeamOrder",{
					userName:"{$userName}",
					params:p
				},function(data){
					if(!data.code){
						callback && callback(data);
					} else {
						$.util.alert(data.msg);
					}
				});
			}
		},
		_initTab: function() {
			var me = this;
			$.util.pageLoading.show();
			me._loadList(me.page,function(){
				$.util.pageLoading.hide();
			});
			$("#prop-list dl").each(function(){
				var dt = $(this).find("dt");
				var dd = $(this).find("dd");
				var width = parseInt(dt.css("width"));
			});

		},
		_initEvent:function(){
			var me=this;
			$.util.initDataLoading({
				me:detail,
				lastChildren:function(){
					return '';
				},
				page:function(){
					return detail.page;
				},
				pageCount:function(){
					return detail.pageCount;
				}
			});

			$("#close").click(function(){
				$("#opacity").hide();$(".mark").hide();
				$("#productInfo").css("bottom",($("#productInfo").height()+50)*-1);
			});
			$(".sub,.plus").on("click", function(e) {
				me._initBuyNum(e);
			});
			$("#prop-list dd").on("click", function(e) {
				me.statisticSelected(this);
			});
			$("#free-list dd").on("click",function(){
				$("#invitation").show();
				$(this).addClass("current").siblings().removeClass("current");
				me.countPerNum();
			});
			$("#buy-team,#buy-now").click(function(){
				window.teamBuyType = $(this).data("type");
				if($(this).data("type")=='team'){
					$("#buyPrice").html('{$teamPrice}');
				}else{
					var price = '{$discountedPrice}'||'{$fixedPrice}';
					$("#buyPrice").html(price);
				}
				detail.productShow(this,1);
			});
			$(".beSure").click(function(){
				if($(this).hasClass("btn_disabled")){return}
				if(!me.status){
					var addCar = document.getElementById("addCar");
					me.addToCart(addCar);
					return;
				}
				if (window.freeBuy == "1") {
					$("#free-list").css({
						"bottom": 0,
						"visibility": "visible"
					});
				}
				me._initBuy($(this));
			});
			$("#favorite").click(function() {
				var me = $(this);
				var favorite = $(this).attr("favorite");
				var customerId = $.util.getParam("customerId");
				if (favorite == "1") {
					var method = "removeFavorite";
				} else {
					var method = "addFavorite";
				}
				$.util.pageLoading.show();
				$.req.get("call.json?customerId=" + customerId + "&module=product&method=" + method, {
					params: {
						"id": '{$id}'
					}
				}, function(data) {
					if (data && !data.code) {
						if (favorite == "1") {
							me.find("i").html("&#xe606;");
							me.attr("favorite", 0);
							me.removeClass('fav1');
						} else {
							me.find("i").html("&#xe607;");
							me.attr("favorite", 1);
							me.addClass('fav1');
						}
					}
					$.util.pageLoading.hide();
				});
			});
			$("#share").click(function(){
				location.href = baseUrl+'call.html?customerId={$platCustomerId}&module=community&method=index&params=&params=%7B"qid":"{$quanInfo.qId}"%7D#/proqcode/{$id}';
			});
		},
		statisticSelected: function(e) {
			var me=this;
			var b = $(e);
			if (!b.hasClass("current") && !b.hasClass("disabled")) {
				b.addClass("current").siblings().removeClass("current");
				$("#buyNum").val(1);
			}
			me._initCount();
		},
		_renderList:function(data,page,callback){
			var me=this;
			if(data){
				var html=template("commentTpl", data),
						container=$("#p-comment");
				container.append(html);
				if(data.count>0){
					container.show();
				}
				me.page=page;
				me.pageCount=data.pageCount;
				callback && callback();
				showImg();
			}
		},
		_loadList:function(page,callback){
			var me=this;

			$.req.get("call.json?module=product&customerId={$customerId}&method=getcommentList",{
				userName:"{$userName}",
				params:{
					"pid":"{$id}",
					"start":page,
					"limit":me.pageSize
				}
			},function(data){
				if(data){

					me._renderList(data,page,callback);
				}
			});

		},
		_initBuyNum: function(e) {
			var me=this;
			var buyNum = $("#buyNum"),
					target = $(e.target),
					type = target.attr("tag"),
					num = 1 * buyNum.val();
			if (target.hasClass("disabled")) {
				return;
			}
			if (num) {
				if (isNaN(num)) {
					buyNum.val(1);
				} else {
					var ktotal = $("#stock-num").html() || 999;
					if(!me.selectedSpec()){
						return;
					}
					if (type == "add") {
						buyNum.val(++num);
						me._initCount();
						$("#sub").removeClass("disabled");
						if(num>=ktotal){
							$("#plus").addClass("disabled");
						}
					} else {
						if (num > 1) {
							buyNum.val(--num);
							$("#plus").removeClass("disabled");
							if (num < 2) {
								$("#sub").addClass("disabled");
							}
						}
					}
				}
			}
			me.countPerNum();
		},
		countPerNum:function(){
			var price =  '{$discountedPrice}'||'{$fixedPrice}';
			var pNum = Math.ceil($.util.accSub(price,$("#free-list dd.current").data("value")));
			var num = $("#buyNum").val();
			pNum = num*pNum;
			if(pNum){
				$("#invitation").html("需要"+pNum+"个好友帮忙减价");
			}else{
				$("#invitation").html( "正常价格，可直接购买。");
			}
		},
		_initCount:function(){
			var availSku = JSON.parse('{$availSku}');
			var inventory = '{$inventory}';
			var inventoryCount = '{$inventoryCount}';
			var playType = '{$playType}';
			var isEnjoyMiPrice = '{$isEnjoyMiPrice}';
			if("{$supportSpecification}"==1) {
				if (availSku) {
					var size = {$size};
					var color = {$color};
					var key = '';
					if (size) {
						var sizeName = $("#prop-list dl:eq(0)").find("dd.current").data("name");
						key += sizeName;
					}
					if (color) {
						var colorName = $("#prop-list dl:eq(1)").find("dd.current").data("name");
						key += "|" + colorName;
					}
					if ((color && !colorName)||!availSku[key])return;
					var fixedPrice = parseFloat(availSku[key].fixedPrice);
					var discountedPrice = parseFloat(availSku[key].discountedPrice);
					var miPrice = parseFloat(availSku[key].miPrice);
					var stockCount = parseInt(availSku[key].inventoryCount);
					if (playType != 3 && '{$freeBuy}' != 1 && '{$teambuy}' != 1) {
						if (playType == 5 && isEnjoyMiPrice == 1) {
							$("#buyPrice").html("密友价：￥" + miPrice);
						} else if (discountedPrice > 0) {
							$("#buyPrice").html("￥" + discountedPrice);
						} else {
							$("#buyPrice").html("￥" + fixedPrice);
						}
					}
					if (parseInt(inventory)) {
						if (stockCount <= 0) {
							$(".soldOut").show();
							$(".beSure").addClass("btn_disabled");
						} else {
							$(".soldOut").hide();
							$(".beSure").removeClass("btn_disabled");
						}
						$("#inventory_count").show();
						$("#stock-num").html(stockCount);
						var nowNum = parseInt($("#buyNum").val());
						if (nowNum >= stockCount) {
							$("#plus").addClass("disabled");
						} else {
							$("#plus").removeClass("disabled");
						}
						if (nowNum < 2) {
							$("#sub").addClass("disabled");
						}
					}
				} else {
					if (parseInt(inventory)) {
						var nowNum = parseInt($("#buyNum").val());
						if (nowNum >= inventoryCount) {
							$("#plus").addClass("disabled");
						} else {
							$("#plus").removeClass("disabled");
						}
					}
				}
			}
		},
		selectedSpec:function(){
			var first=$("#prop-list dl").eq(0);
			var second=$("#prop-list dl").eq(1);
			var supportSpecification='{$supportSpecification}' || 0;
			if(parseInt(supportSpecification)) {
				if($("#prop-list dl").size()>0){
					if((first && !first.find(".current").size()) ){
						var name ="{$sizeUnit}";
						$.util.alert("请选择"+name+"!");
						return false;
					}
					if(second.length>0 && !second.find(".current").size()){
						var name ="{$colorUnit}";
						$.util.alert("请选择"+name+"!");
						return false;
					}
				}
			}
			var freeBuy = parseInt('{$freeBuy}');
			if( freeBuy&&!$("#free-list dd").hasClass("current")){$.util.alert("没有选择价格");return;}
			return true;
		},
		productShow:function(ctrl,status){
			var me= this;
			me.status = status;
			if($(ctrl).hasClass("btn-disabled")){return;}
			$("#buyNum").val(1);
			$("#invitation").hide();
			$("#productInfo").addClass("show");
			$(".mark").show();
			$("#productInfo").css("bottom",0);
		},
		getShareUrl:function(){
			var p=$.util.getParamAsObject();
			var shareUrl="";
			var me=this;
			var mallQId = "{$quanInfo.qId}";
			var mallUId = "{$quanInfo.uId}";
			if(p.qId||(mallQId&&mallUId)){
				var params={
					"id":"{$id}",
					"fromUserName":"{$userName}",
					"qId":p.qId||mallQId,
					"miUId":p.miUId||mallUId,
					"visitId":shareData.visitId,
					"lastShareUId":shareData.lastShareUId
				}
			}else{
				var params={
					"id":"{$id}",
					"fromUserName":"{$userName}",
					"visitId":shareData.visitId,
					"lastShareUId":shareData.lastShareUId
				}

			}
			params=encodeURIComponent(JSON.stringify(params));
			shareUrl=baseUrl+'call.html?customerId={$customerId}&module=product&method=getProduct&params='+params;
			return shareUrl;
		},
		goCart:function(vId){
			var p=$.util.getParamAsObject();
			var params=$.extend(p,{
				"sid":"-1",
				"type":"buy",
				"tplid":"4",
				"mid":4,
				"vId":vId,
				"qId":p.qId||"{$quanInfo.qId}",
				"miUId":p.miUId||"{$quanInfo.miUId}"
			});
			params=encodeURIComponent(JSON.stringify(params));
			location.href = 'call.html?customerId={$customerId}&module=product&method=getCart&params=' + params;
		},
		carInfo:function(){
			var me = this;
			if($("#prop-list dl").length>0 && inventory) {
				var pros = [];
				var prosName = [];
				$("#prop-list dl").each(function (i) {
					$(this).find("span").each(function () {
						if ($(this).hasClass("current")) {
							if (i == 0) {
								size = $(this).data("value");
							}
							if (i == 1) {
								color = $(this).data("value");
							}
							pros.push($(this).data("value"));
							prosName.push($(this).text());
						}
					});
				});
				pros = pros.join("|");
				var key = pid + "|" + pros;
				return me.cartList[key];
			}else{
				return me.cartList[pid];
			}
		},
		selectPrice:function(){
			var me = this;
			$("#free-list").css({"bottom":0,"visibility":"visible"});
			var freeBuy = parseInt('{$freeBuy}');
			if( freeBuy){$("#free-list span.current").removeClass("current");$("#invitation").hide();}
			$("#free-list a").click(function(){
				var freeBuy = parseInt('{$freeBuy}');
				if( freeBuy&&!$("#free-list span").hasClass("current")){$.util.alert("没有选择价格");return;}
				$("#free-list").css("bottom",-$("#free-list").height()+"px");
				$("#free-list").one("webkitTransitionEnd",function(){
					var addCar = document.getElementById("addCar");
					me.addToCart(addCar);
				})
			});
		},
		addToCart:function() {
			var index = $(".ui-slider-dots .ui-state-active").index();
			var inventory = '{$inventory}';
			var img = $("div.ui-slider img:eq("+index+")");
			var me=this;
			var num = parseInt($("#buyNum").val());
			var p=$.util.getParamAsObject();
			if(!me.selectedSpec()){return;}
			var sizeprop = '{$size}';
			var freeBuy = parseInt('{$freeBuy}');
			if( freeBuy&&!$("#free-list dd").hasClass("current")){$.util.alert("没有选择价格");return;}
			if(sizeprop&&sizeprop!='null') {
				var size = $("#prop-list dl").eq(0).find("dd.current").data("name") || "";
				var color = $("#prop-list dl").eq(1).find("dd.current").data("name") || "";
				if(parseInt(inventory)){
					var key = '';
					var key1 = {$id};
					if (size) {
						key += size;
					}
					if (color) {
						key += "|" + color;
					}
					key1 += "|" + key;
					var availSku = JSON.parse('{$availSku}');
					var nowNum = parseInt(availSku[key].stockCount);
					if (num > nowNum) {
						$.util.alert("购买数量不能超过库存限制");
						return;
					}
					var carPro = me.cartList[key1];
					if (carPro) {
						var carNum = parseInt(carPro.count);
						if (carNum + num > nowNum) {
							$.util.alert("购买数量不能超过库存限制");
							return;
						}
					}
				}
			}
			var freeBuy = "{$freeBuy}";
			var customizedDescription1 = $(".customizedDescription:eq(0)").val();
			if($(".customizedDescription:eq(0)").data("type")==1){
				customizedDescription1 = customizedDescription1.replace("T"," ");
			}
			var customizedDescription2 = $(".customizedDescription:eq(1)").val();
			if($(".customizedDescription:eq(1)").data("type")==1){
				customizedDescription2 = customizedDescription2.replace("T"," ");
			}
			var customizedDescription3 = $(".customizedDescription:eq(2)").val();
			if($(".customizedDescription:eq(2)").data("type")==1){
				customizedDescription3 = customizedDescription3.replace("T"," ");
			}
			var pa={
				"pid":"{$id}",
				"type":"buy",
				"count":num,
				"size":size,
				"color":color,
				"qId":p.qId||"{$quanInfo.qId}",
				"miUId":p.miUId||"{$quanInfo.uId}",
				"vId":p.vId,
				"shareId":p.sId,
				"shareFormGuid":p.fromGuid || "",
				"visitId":"{$visitId}",
				"customizedName1":$(".customizedName:eq(0)").html(),
				"customizedDescription1":customizedDescription1,
				"customizedName2":$(".customizedName:eq(1)").html(),
				"customizedDescription2":customizedDescription2,
				"customizedName3":$(".customizedName:eq(2)").html(),
				"customizedDescription3":customizedDescription3
			};
			if(parseInt(freeBuy)){
				pa.deposit=$("#free-list dd.current").data("value");
			}
			$.req.get("call.json?module=product&customerId={$customerId}&method=updateOrderDetail", {
				userName: "{$userName}",
				params: pa
			},function(data){
				if(!data.code){
					$.util.alert("加入购物车成功");
					mi.PRODUCT_DETAIL.getCartGoodsNum();
					$("#productInfo").css("bottom",-($("#productInfo").height()+50)+"px");
					$(".mark").hide();
				}
			})
		},
		_initBuy:function(ctrl){
			var me = this;
			var p=$.util.getParamAsObject();
			var data=me.curData;
			if (!$(ctrl).hasClass("btn-disabled")) {
				if ($("#prop-list dl").length != 0) {
					var size = $("#prop-list dd.current").size();
					var sku = me.sku;
					var isValidate = true;
					var sizes = '';
					var colors = '';
					$("#prop-list dl").each(function () {
						if (!$(this).find("dd").hasClass("current")) {
							$.util.alert('请选择' + $(this).find("dt").text());
							isValidate = false;
							return false;
						} else {
							sizes = $("#prop-list dl:eq(0)").find("dd.current").data("name");
							colors = $("#prop-list dl:eq(1)").find("dd.current").data("name");
						}
					});
					if (!isValidate) {
						return false;
					}
				}
				if ($("#free-list").length && !$("#free-list dd").hasClass("current")) {
					$.util.alert('请选择价格');
					return;
				}
				if ($("#stock-num") &&$("#stock-num").html()&& $("#stock-num").html() <= 0) {
					$.util.alert("库存不足");
					return;
				}
				var customizedDescription1 = $(".customizedDescription:eq(0)").val();
				if($(".customizedDescription:eq(0)").data("type")==1){
					customizedDescription1 = customizedDescription1.replace("T"," ");
				}
				var customizedDescription2 = $(".customizedDescription:eq(1)").val();
				if($(".customizedDescription:eq(1)").data("type")==1){
					customizedDescription2 = customizedDescription2.replace("T"," ");
				}
				var customizedDescription3 = $(".customizedDescription:eq(2)").val();
				if($(".customizedDescription:eq(2)").data("type")==1){
					customizedDescription3 = customizedDescription3.replace("T"," ");
				}
				var params = {
					"pids":$(ctrl).data("id"),
					"sizes": sizes,
					"colors": colors,
					"counts": $("#buyNum").val(),
					"type":"buy",
					"customizedName1":$(".customizedName:eq(0)").html(),
					"customizedDescription1":customizedDescription1,
					"customizedName2":$(".customizedName:eq(1)").html(),
					"customizedDescription2":customizedDescription2,
					"customizedName3":$(".customizedName:eq(2)").html(),
					"customizedDescription3":$(".customizedDescription:eq(2)").val()
				};
				if(window.buyParams) {
					params = $.extend(params, window.buyParams);
				}
				$(ctrl).addClass("btn-disabled");
				$.util.pageLoading.show();
				if (window.freeBuy == "1") {
					if (!$("#free-list dd").hasClass("current")) {
						$.util.alert("没有选择价格");
						return;
					}
					params.deposits = $("#free-list dd.current").data("value");
				}
				if (window.isTeamPro == "1") {
					params.teamBuyType = window.teamBuyType;
				}
				$.req.get("call.json?customerId={$customerId}&module=product&method=preSubmitOrder", {
					params: params
				}, function (data) {

					if (data.hasOwnProperty('code')) {
						$(ctrl).removeClass("btn_disabled").removeClass("btn-disabled");
						$.util.showMsg(data.msg);
						$.util.pageLoading.hide();
					} else {
						var p = {
							"tplid": 1,
							"id": data.id
						}
						if (window.isTeamPro == "1" && window.teamBuyType == 'team'){
							detail.tuan.createTeamOrder(data.id, function (data) {
								if (data && !data.code) {
									$.util.pageLoading.hide();
									$(ctrl).removeClass("btn_disabled").removeClass("btn-disabled");
									location.href = window.hrefPath + '&module=product&method=getOrderDetail&force=1&params=' + encodeURIComponent(JSON.stringify(p));
								}
							});
						}else{
							location.href = window.hrefPath + '&module=product&method=getOrderDetail&force=1&params=' + encodeURIComponent(JSON.stringify(p));
						}
					}
				});
			}
		}

	}
	detail.init();
	mi.PRODUCT_DETAIL.getCartGoodsNum();
	var shareUrl=detail.getShareUrl();
	wx_share.init({
		"title":"{$title}",
		"desc":'{$recommend}',
		"link":shareUrl,
		"imgUrl": $.trim($("#shareImg").val()),
		"pkg":{
			"appId": '{$pkg.appId}',
			"timestamp": '{$pkg.timestamp}',
			"nonceStr": '{$pkg.nonceStr}',
			"signature": '{$pkg.signature}'
		},
		success:function(config,shareType){
			var p=$.util.getParamAsObject();
			$.req.get("call.json?customerId={$customerId}&module=quan&method=saveShare",{
				params:{
					"qId":p.qId,
					"sId":"{$sId}",
					"guid":detail.guid,
					"fromGuid":p.fromGuid || "",
					"miUId":p.miUId,
					"shareType":shareType,
					"fromPage":"product_detail",
					"visitId":shareData.visitId,
					"lastShareUId":shareData.lastShareUId
				}
			},function(data){
				if(data && !data.code){
					detail.guid=data.guid;
				}
			});
		}
	});
	var showImg=function(){

		$('.comnt-img').each(function(){
			var imgs=new Array;
			$(this).children().each(function(){
				var _index=$(this).find('img').attr('src').split('@')[0];
				imgs.push(_index);
			})
			$(this).children().unbind('click');
			$(this).children().click(function(){
				var activeImg=$(this).find('img').attr('src').split('@')[0];
				wx_share.showImg(imgs,activeImg);
			})
		});
	}


</script>
</body></html>
